package shujia.day04.ketang;

class Teacher {
    public void teach(String kc) {
        System.out.println("教学：" + kc);
    }
}

class Demo1{
    //今后，当你看到一个类作为方法的参数类型的时候
    //将来调用时需要传入该类或者该类的子类的对象
    public void fun1(Teacher t, String ke){ // Teacher t = new Teacher()
        t.teach(ke);
    }
}

public class TeacherDemo {
    public static void main(String[] args) {
        Demo1 d = new Demo1();
//        Teacher t1 = new Teacher();
        //没有名字的对象叫做匿名对象
        d.fun1(new Teacher(), "java");
    }
}
